<html>
<head>
<title>CSW - OGC CSW (Catalog Service for the Web)</title>
</head>

<body bgcolor="#ffffff">

<h1>CSW - OGC CSW (Catalog Service for the Web)</h1>

(GDAL/OGR &gt;= 2.0)<p>

This driver can connect to a OGC CSW service. It supports CSW 2.0.2 protocol.
GDAL/OGR must be built with Curl support in order to the
CSW driver to be compiled. And the GML driver should be set-up for read support
(thus requiring GDAL/OGR to be built with Xerces or Expat support).<p>

It retrieves records with Dublin Core metadata.<p>

<h2>Dataset name syntax</h2>

The minimal syntax to open a CSW datasource is : <i>CSW:</i> and the URL open option,
or <i>CSW:http://path/to/CSW/endpoint</i><p>

The following open options are available:
<ul>
<li><b>URL</b>: URL to the CSW server endpoint (if not specified in the connection string already)</li>
<li><b>ELEMENTSETNAME</b>=brief/summary/full: Level of details of properties. Defaults to <i>full</i>.</li>
<li><b>FULL_EXTENT_RECORDS_AS_NON_SPATIAL</b>=YES/NO: Whether records with
(-180,-90,180,90) extent should be considered non-spatial. Defaults to NO.</li>
<li><b>OUTPUT_SCHEMA</b>=URL : Value of outputSchema parameter, in the restricted
set supported by the serve. Special value <i>gmd</i> can be used as a shortcut for
http://www.isotc211.org/2005/gmd, <i>csw</i> for http://www.opengis.net/cat/csw/2.0.2.
When this open option is set, a <i>raw_xml</i> field will be filled with the
XML content of each record. Other metadata fields will remain empty.</li>
<li><b>MAX_RECORDS</b>=value : Maximum number of records to retrieve in a single time.
Defaults to 500. Servers might have a lower accepted value.</li>
</ul>

<h2>Filtering</h2>

The driver will forward any spatial filter set with SetSpatialFilter() to
the server. It also makes its best effort to do the same for attribute
filters set with SetAttributeFilter() when possible
(turning OGR SQL language into OGC filter description).<p>

The <i>anytext</i> field can be queried to do a search in any text field. Note that
we always return it as null content however in OGR side, to avoid duplicating information.<p>

<h2>Issues</h2>

Some servers do not respect EPSG axis order, in particular latitude, longitude
order for WGS 84 geodetic coordinates, so it might be needed to specify
the GML_INVERT_AXIS_ORDER_IF_LAT_LONG=NO configuration option in those cases.<p>

<h2>Examples</h2>

<li>
Listing all the records of a CSW server:
<pre>
ogrinfo -ro -al -noextent CSW:http://catalog.data.gov/csw
</pre>
<p>

<li>
Listing all the records of a CSW server with spatial and an attribute filter on a give field:
<pre>
ogrinfo -ro -al -noextent CSW:http://catalog.data.gov/csw -spat 2 49 2 49 -where "subject LIKE '%mineralogy%'"
</pre>
<p>

<li>
Listing all the records of a CSW server that matches a text on any text field:
<pre>
ogrinfo -ro -al -q CSW:http://catalog.data.gov/csw -spat 2 49 2 49 -where "anytext LIKE '%France%'"
</pre>
<p>

<li>
Listing all the records of a CSW server as ISO 19115/19119:
<pre>
ogrinfo -ro -al -q CSW:http://catalog.data.gov/csw -oo OUTPUT_SCHEMA=gmd
</pre>
<p>

<h2>See Also</h2>

<ul>
<li> <a href="http://www.opengeospatial.org/standards/cat">OGC CSW Standard</a><p>
<li> <a href="drv_gml.html">GML driver documentation</a></a><p>
</ul>

</body>
</html>
